//*******************************************************
// Account1.java
// ÀÔ±Ý, Ãâ±Ý, ¼ÒÀ¯ÁÖ º¯°æ, °èÁÂÁ¤º¸ Á¦°øÀÇ ¸Þ¼ÒµåµéÀ»
// °¡Áö´Â ÀºÇà °èÁÂ Å¬·¡½º
//*******************************************************
public class Account1
{
	private double balance;
	private String name;
	private long acctNum;
	//----------------------------------------------
	// ±¸¼ºÀÚ - ÀÜ¾×, ¼ÒÀ¯ÁÖ, °èÁÂ¹øÈ£¸¦ ÃÊ±âÈ­ÇÑ´Ù.
	//----------------------------------------------
	public Account1(double initBal, String owner, long number)
	{
		balance = initBal;
		name = owner;
		acctNum = number;
	}
	//----------------------------------------------
	// ÀÜ¾×ÀÌ Ãâ±ÝÀ» ÇÏ±â¿¡ ÃæºÐÇÑÁö È®ÀÎÇÏ°í,
	// ¸¸¾à ±×·¸´Ù¸é, ÀÜ¾×¿¡¼­ Ãâ±Ý¾× ¸¸Å­À» Á¦ÇÏ°í,
	// ±×·¸Áö ¾Ê´Ù¸é, ¸Þ¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
	//----------------------------------------------
	public void withdraw(double amount)
	{
		if (balance >= amount)
			balance -= amount;
		else
			System.out.println("출금액이 부족합니다.");
	}

	//----------------------------------------------
	// ÀÜ¾×¿¡ ÀÔ±Ý¾×À» ´õÇÑ´Ù.
	//----------------------------------------------
	public void deposit(double amount)
	{
		balance += amount;
	}

	//----------------------------------------------
	// ÀÜ¾×À» ¹ÝÈ¯ÇÑ´Ù.
	//----------------------------------------------
	public double getBalance()
	{
		return balance;
	}

	//----------------------------------------------
	// ¼ÒÀ¯ÁÖ, °èÁÂ¹øÈ£, ÀÜ¾×À» ¹®ÀÚ¿­·Î ¹ÝÈ¯ÇÑ´Ù.
	//----------------------------------------------
	public String toString()
	{
		return "Name:" + name +
			"\nAccount Number: " + acctNum +
			"\nBalance: " + balance;
	}
}

